﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Code.Models
{
    /// <summary>
    /// 支付信息状态
    /// </summary>
    public enum PayResult
    {
        /// <summary>
        /// 撤销订单
        /// </summary>
        Cancel=-2,
        /// <summary>
        /// 支付出错
        /// </summary>
        Error=-1,
        /// <summary>
        /// 等待支付
        /// </summary>
        WatingPay=0,
        /// <summary>
        /// 支付成功
        /// </summary>
        Success=1,
    }

    public static class PayResultEc
    {
        public static string GetName(this PayResult result)
        {
            switch (result)
            { 
                case PayResult.WatingPay:
                    return "等待支付";
                case PayResult.Success:
                    return "支付成功";
                case PayResult.Error:
                    return "支付失败";
                case PayResult.Cancel:
                    return "撤销支付";
                default:
                    return result.ToString();
            }
        }
    }
}
